// pages/venue_qr/venue_qr.js
var app = getApp()
Page({

  data: {
    c_src: ''
  },

  onLoad: function (options) {
    console.log(options);
    this.getCodeByC(options.venue_id)
  },
  // 获取C模式下的二维码
  getCodeByC: function (venue_id) {
    console.log(venue_id)
    var that = this,
      url = app.url + 'weiapp/Api/getwxacode&PHPSESSID=' + wx.getStorageSync('PHPSESSID');
    wx.request({
      url: url,
      data: { type: 'C', param: { path: app.url + '/weiapp/api/gotoClass/venue_id/' + venue_id, width: 400 } },
      success: function (res) {
        if (res.data.status == 0) {
          that.showError(res.data.msg)
        } else {
          that.setData({ 'c_src': res.data.url })
        }
      }
    })
  }  
})